<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
</head>

<body>
    <input type='text' value=1>
    <script>
        const input = document.querySelector('input');
        let value=input.value;
        setInterval(()=>{
            if(value!==input.value){
            location.reload();
        }
        },20);
        setTimeout(() => {
            input.value = 2;
        }, 2000)

        
    </script>
</body>

</html>